#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include "colormaker.h"

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    /* 向QML注册类型 */
//    qmlRegisterType<ColorMaker>("an.qt.ColorMaker", 1, 0, "ColorMaker");

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    /* 向QML注册ColorMaker对象 */
    engine.rootContext()->setContextProperty("colorMaker", new ColorMaker);

    return app.exec();
}
